//配置路由相关信息
import {createRouter, createWebHashHistory, createWebHistory} from "vue-router"
import PageRouter from './page/index'
import ViewsRouter from './views/index'
import AvueRouter from './avue-router'
import Store from '@/store'
//定义路由
const routes =[...PageRouter,...ViewsRouter]

//  创建路由实例
const router = createRouter({
  // 采用hash 模式
  history: createWebHashHistory(),
  // 采用 history 模式
  // history: createWebHistory(),
  routes, //使用上方定义的路由配置
});
AvueRouter.install(router, Store)
router.$avueRouter.formatRoutes(Store.state.user.menu, true)
export default router 